<?php $view->extend('Site1Bundle:Module:layout') ?>
<form action="<?php $key = $module->getKeys(); $key = $key[0]; echo $view->router->generate('module_edit', array('id' => $key)); ?>" method="post">
        <table border="1">
            <thead>
                <th>
                    #
                </th>
                <?php foreach($module->getPlugins() as $plugin): ?>
                <th <?php echo \count($plugin->getFields()) > 1 ? 'colspan="' . \count($plugin->getFields()) .'"' : '';?>>
                    <?php echo $plugin->getTitle(); ?>
                </th>
                <?php endforeach; ?>
            </thead>
            <tr>
                <td>
                    <input type="checkbox" checked="<?php echo $module->isHidden(0) ? 'true' : 'false'; ?>" name="hidden" />
                </td>
                <?php foreach($module->getPlugins() as $name => $plugin): ?>
                    <td>
                    <?php foreach($plugin->getFields() as $fieldName => $field): ?>
                        <?php echo $field->getFormField($name, $fieldName); ?>
                            
                    <?php endforeach; ?>
                    </td>
                <?php endforeach; ?>
            </tr>
            <tr>
                <td colspan="2"><input type="submit"/></td>
                <td colspan="2"><input type="reset"/></td>
            </tr>
        </table>
</form>